package main

import (
	"fmt"
	"os/exec"
	"sync"
)

func pingIP(ip string, wg *sync.WaitGroup) {
	defer wg.Done()
	cmd := exec.Command("ping", ip)
	if err := cmd.Run(); err != nil {
		fmt.Println(ip, "is Down")
	} else {
		fmt.Println(ip, "is Up")
	}
}

func main() {
	var wg sync.WaitGroup
	baseIP := "172.30.38."

	for i := 110; i <= 120; i++ {
		ip := fmt.Sprintf("%s%d", baseIP, i)
		wg.Add(1)
		go pingIP(ip, &wg)
	}
	wg.Wait()
}
